<template>
  <div class="page result">
    <div class="scroll-view">
      <customHeader
        :middleTitle="header"
        rightTitle="完成"
        :noLeft="true"
        @leftCallBack="handleComplete"
        @rightCallBack="handleComplete"
      />
      <div class="page-body">
        <result type="success" :title="title" :msg="msg"/>
      </div>
    </div>
  </div>
</template>

<script>
import Vue from "vue";
import customHeader from "../../components/header/header";
import result from "../../components/result/result";
import jsBridge from "../../tools/jsBridge.js";

export default {
  name: "sendSuccess",
  data() {
    return {
      title: "已发送",
      msg: "对账单将在3-5分钟之后发送成功",
      header: "对账单",
    };
  },
  methods: {
    //点击完成
    handleComplete() {
      if(String(this.$route.query.close) == 'true'){
        jsBridge.closeWindow();
      }else{
        this.$router.back();
      }
    }
  },
  components: {
    customHeader,
    result
  },
  created() {
    if(this.$route.query.msg){
      this.msg=this.$route.query.msg;
    }
    if(this.$route.query.title){
      this.title=this.$route.query.title;
    }
    if(this.$route.query.header){
      this.header=this.$route.query.header;
    }
  }
};
</script>

